import router from './router'
import pinia from './store'
import LocalCache from '@/utils/cache'
import { apiListProject } from '@/api/modules/login'


let list = []

const initProject = async () => {
  const res = await apiListProject()
  console.log('----------temp002', res)
  if (res.success) {
    list = res.data
  }
  console.log('----------temp003', list)
}
initProject()
const temp = []
if (Array.isArray(list) && list.length > 0) {
  list.forEach(item => {
    temp.push({
      name: item.appEname,
      entry: process.env.NODE_ENV !== 'production' ? item.appDesc : `${item.routePath}/`,
      container: `#${item.appEname}`,
      activeRule: `${item.routePath}/`
    })
  })
}
console.log('----------temp004', temp)
const apps = temp.map((item) => {
  return {
    ...item,
  }
})
console.log('----------temp', temp, apps)

// const microApps = [
//   {
//     name: 'portal-vue',
//     // entry: process.env.VUE_APP_SUB_PORTAL,
//     entry: process.env.NODE_ENV !== 'production' ? '//localhost:3001/' : '//10.48.76.1/portal-vue/',
//     container: '#portal-vue',
//     activeRule: '/portal-vue/',
//     props: { data: { pinia, router } },
//   },
// ]

// const apps = microApps.map((item) => {
//   return {
//     ...item,
//   }
// })

export default apps
